<?php

namespace module\index\validate;

use app\Validate;

class UserLearnLog extends Validate
{
    /**
     * 所有验证场景需要的字段.
     *
     * @var array<array>
     */
    protected $scene = [
        'save' => ['album_id', 'step'],
    ];
    /**
     * Get the validation rules that apply to the request.
     *
     * @var array<string>
     */
    protected $rule = [
        'id' => 'require|integer|max:10',
        'album_id' => 'requireWithout:id|integer|exists:activity_album,id',  // 相册ID
        'step' => 'requireWithout:id|integer|max:5',
    ];
    /**
     * 验证字段描述
     * 
     * @var array<string>
     */
    protected $field = [
        'album_id' => '相册',  // 相册ID
        'step' => '观看记录', 
    ];  
}
